package cn.anecansaitin.jep.parser.ast.node.expression.literal;

import cn.anecansaitin.jep.Token;
import cn.anecansaitin.jep.TokenType;
import cn.anecansaitin.jep.types.TypeInfo;

public final class LongLiteral extends Literal {
    private final long value;

    public LongLiteral(Token longToken) {
        this(longToken.value(), longToken.line(), longToken.column());
    }

    public LongLiteral(String value, int line, int column) {
        super(TokenType.LONG_LITERAL, TypeInfo.LONG, line, column);
        this.value = Long.parseLong(value);
    }

    public long value() {
        return value;
    }
}